/**
 * 
 */
package com.taobao.snowsnow.hibernate.service.impl;

import java.util.List;

import com.taobao.snowsnow.hibernate.dao.BuyyerDao;
import com.taobao.snowsnow.hibernate.pojo.Buyyer;
import com.taobao.snowsnow.hibernate.service.BuyyerService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 上午09:55:17
 */
public class BuyyerServiceImpl extends BaseServiceImpl implements BuyyerService {
	private BuyyerDao bbdao;
	
	public BuyyerDao getBbdao() {
		return bbdao;
	}

	public void setBbdao(BuyyerDao bbdao) {
		this.bbdao = bbdao;
	}

	public List<Buyyer> findAll() {
		try {
			return bbdao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Buyyer findById(int id) {
		try {
			return bbdao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}
	
	public List<Buyyer> findByName(String name) {
		try {
			return bbdao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return bbdao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Buyyer> paging(int page, int limit)  {
		try {
			return bbdao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	@Override
	public Buyyer getFirstObject() {
		try {
			return bbdao.getFirstObject();
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Buyyer getFirstObject()");
		}
		return null;
	}

	@Override
	public Buyyer getLastObject() {
		try {
			return bbdao.getLastObject();
		} catch(Exception e) {
			e.printStackTrace();
			System.out.println("Buyyer getLastObject()");
		}
		return null;
	}

	@Override
	public Buyyer findByNamePrecise(String name) {
		try {
			return bbdao.findByNamePrecise(name);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Buyyer getLastObject()");
		}
		return null;
	}

	@Override
	public List<Buyyer> findByTaoBaoID(String nick) {
		try {
			return bbdao.findByTaoBaoID(nick);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Buyyer findByTaoBaoID()");
		}
		return null;
	}

	@Override
	public Buyyer findByTaoBaoIDPrecise(String nick) {
		try {
			return bbdao.findByTaoBaoIDPrecise(nick);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Buyyer findByTaoBaoIDPrecise()");
		}
		return null;
	}
}
